package com.lxz.usercenter.common;

import lombok.Data;

/**
 * 通用返回类
 * @param <T>
 */
@Data
public class BaseResponse<T> {
    private int code;
    private String message;
    private T data;

    private String description;

    public BaseResponse(int code, T data,String message , String description) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.description = description;
    }

    public BaseResponse(int code, T data ,String description) {
        this(code,data,"","");
    }

    public BaseResponse(int code, T data) {
       this(code,data,"","");
    }

    public BaseResponse(ErrorCode code) {
        this(code.getCode(),null,code.getMessage(),code.getDescription());
    }


}
